package com.wws.family.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import com.wika.basics.base.BaseBindViewHolder
import com.wika.basics.base.BaseRecyclerViewAdapter
import com.wws.family.databinding.ItemDialogSelectBinding
import com.wws.family.utils.PublicUtils

/**
 *@Description:选择弹出框Adapter
 *@Date: 2025/1/7 22:28
 *@Author: WangWeiShuo
 */
class DialogSelectAdapter(private var context: Context):BaseRecyclerViewAdapter<PublicUtils.MedicineType,ItemDialogSelectBinding>() {
    override fun onBindDefViewHolder(
        holder: BaseBindViewHolder<ItemDialogSelectBinding>,
        item: PublicUtils.MedicineType?,
        position: Int
    ) {
        holder.binding.ivSelectIcon.background = context.getDrawable(item?.icon!!)
        holder.binding.tvSelectName.text = item?.name
    }

    override fun getViewBinding(
        layoutInflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): ItemDialogSelectBinding {
        return ItemDialogSelectBinding.inflate(layoutInflater,parent,false)
    }
}